package com.janyee.powerdroid.http.callback

import com.alibaba.fastjson.JSON
import com.alibaba.fastjson.JSONObject
import okhttp3.Response

/**
 * Created by kmlixh on 17/5/5.
 * useage:
 * PowerDroid
 */
abstract class JsonCallBack<T>: BaseCallBack<T, JSONObject>() {
    override fun transform(response: Response?): JSONObject? {
        var result:JSONObject?=null
        if(response!=null){
            try {
                result= JSON.parseObject(response.body().string())
            }catch (e:Exception){
                e.printStackTrace()
            }
        }
        return result
    }
}